#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"

# RECIPE START cpio-static

reset_mtime cpio cpio/configure.ac
rm -rf build/cpio-static
mkdir -p build/cpio-static
cd build/cpio-static
env LDFLAGS="$LDFLAGS -static" \
../../cpio/configure \
	${CONFIGURE_ARGS} \
	${AUTOCRAP_KLUDGE}

make -j${JOBS}
make -j${JOBS} install DESTDIR=`pwd`/inst
mkdir -p "${stage}${prefix}/bin"
cp -a inst${prefix}/bin/cpio "${stage}${prefix}/bin/cpio.static"

cd ../..
rm -rf build/cpio-static

# RECIPE END cpio-static

